/**

    \file usm_cs_extern.h

    COPYRIGHT(C) 2008,ShenZhen JiuZhou CO.,LTD. \n

    All rights reserved. \n

    \brief global macros and data types for charset module.

    \version Ver1.0

    \date 2009-3-9 Monday

    \author Yang Feng<yangfeng@aaa.com>

    \note Created

*/


/* Define to prevent recursive inclusion */
#ifndef __USM_CS_EXTERN_H__
#define __USM_CS_EXTERN_H__

/* Includes ------------------------------------------------------------ */
#include "usm_typedef.h"
#include "usm_charset.h"

/* Macros --------------------------------------------------------------*/
#define BIG5_SIZE                  19582
#define KSC_SIZE                     4303
#define JIS_SIZE                      7724
#define ISO8859_1_SIZE            96       
#define ISO8859_2_SIZE            96
#define ISO8859_3_SIZE            89   
#define ISO8859_4_SIZE            96
#define ISO8859_5_SIZE            96   
#define ISO8859_6_SIZE            51
#define ISO8859_7_SIZE            93   
#define ISO8859_8_SIZE            60
#define ISO8859_9_SIZE            96   
#define ISO8859_10_SIZE          96
#define ISO8859_11_SIZE          88     
#define ISO8859_12_SIZE           0
#define ISO8859_13_SIZE          96     
#define ISO8859_14_SIZE          96
#define ISO8859_15_SIZE          96     
#define ISO8859_16_SIZE          96


#define UNSUPPORTED_CHAR      ' ' 

#define isHeadOfOneByteChar(b)    (((b) & 0x80) == 0x00)
#define isHeadOfTwoBytesChar(b)    (((b) & 0xE0) == 0xC0)
#define isHeadOfThreeBytesChar(b)   (((b) & 0xF0) == 0xE0)
#define isComingByteOfMultBytesChar(b)  (((b) & 0xC0)==0x80)
#define isHeadOfUTF8Char(b) \
	isHeadOfOneByteChar(b) || \
	isHeadOfTwoBytesChar(b) || \
isHeadOfThreeBytesChar(b)


/* Global Variables ------------------------------------------------------- */
extern JZ_UINT16 nArrTableLen[USM_CS_FORMAT_END];

/* Global Types -----------------------------------------------------------*/


/* global Function  -------------------------------------------- */
JZ_Error_t USM_CS_GetMatchedCode(JZ_UINT16 nMappingTable[][2], JZ_UINT16 nTableLen, JZ_UINT16 nCode, JZ_UINT16 *pnMatchedCode);


#endif

